package com.atguigu;

import redis.clients.jedis.Jedis;

public class JedisDemo {
    public static void main(String[] args) {
        //1.获取Redis链接
        Jedis jedis = new Jedis("hadoop102", 6379);
//        System.out.println(jedis.ping());
        //写数据
        //String
//        jedis.set("230315", "good");

        //List
        jedis.lpush("202315list", "good");

        //Set
        jedis.sadd("2023015Set", "good");

        //hash
        jedis.hset("2023015Hash", "lina", "very good");

        //Zset
        jedis.zadd("230315Zset", 100, "good");


        //关闭链接
        jedis.close();
    }
}
